package pt.eden.tomcat.jms;

import javax.naming.Reference;

/**
 * Interface to create a new instance of a resource using the provided properties.
 */
public interface ResourceFactory<T> {

    /**
     * Creates a new instance of a resource.
     *
     * @param reference reference attributes
     * @return new resource instance
     * @throws Exception thrown when the resource cannot be instantiated.
     */
    T createReference(Reference reference) throws Exception;
}
